#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve()
{
    string s;
    cin >> s;
    unordered_map<char, int> lcnt;
    unordered_map<char, int> rcnt;
    int n = s.size() / 2;
    for (int i = 0; i < n; i++) lcnt[s[i]]++;
    for (int i = n; i < s.size(); i++) rcnt[s[i]]++;
    int left = INT_MAX, right = INT_MAX;
    for (int i = 0; i < n; i++) left = min(left, n - lcnt[s[i]]);
    for (int i = n; i < s.size(); i++) right = min(right, n - rcnt[s[i]]);
    cout << left + right;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    //cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}